-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JOH-48] Update pet type #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍀, iirc the rest function in image service will be implemented right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure that what AssignPet
function use for?
and iirc there're Delete
Upload
and AssignPet
that have to implement in image service
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image.Upload(): uploads to S3 and create a row with url of that S3 (empty foreign key)
If upload has field petId, then petId will be filled (meaning image is created and assigned a pet at the same time)
image.AssignPet(): assigns row with specified url with that pet id (add foreign key)
image.Delete(): deletes row and object in S3
—--------------------------------
When creating pet,
For image upload, POST it, and keep the imageId from response
imageSrv.Upload(file) returns URL + imageId
For pet create, attach images’ urls into the POST request
petSrv.Create(pet + imageIds) => image.AssignPet(imageIds, petId)
—--------------------------------
When updating pet,
If delete image -> imageSrv removes the row with ID == image.id, bucket also deletes (image id got from FindByPetId fetched by client)
If upload image -> imageSrv.Upload()
Image svc in File repo is already done,
Pet svc in Backend repo still needs to use real image svc (currently they are empty [ ])
For gateway, make 3 endpoints for upload, assignpet and delete
Change made
Describe what you have done
New Features
Fix
Others